import { request } from "../../utils/wxCommon";

// pages/my/my.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:{}
  },
  onChange(e){
    const type = e.currentTarget.dataset.type;
    if(type == 1){//跳转到我的简历页面
      wx.navigateTo({
        url: '/pages/myResume/myResume',
      })
    }else{//设置
      wx.navigateTo({
        url: '/pages/setting/setting',
      })
    }
  },
  init(){
    const params = {
      type: 14,
      openid: wx.getStorageSync('usreInfo').openid
    }
    request('user',params).then(res=>{
      console.log(res);
      if(res.result.status === 'S'){
        this.setData({
          list: res.result.data.data[0].data
        })
      }else{
        this.setData({
          list:{
            logo:'../../static/icon/user-logo.png',
            name:'爱吹牛的胡萝卜'
          }
        })
      }
    }).catch(msg=>{
      console.log(msg);
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onShow: function (options) {
    this.init()
  },

  
})